<?php
	require_once(realpath(dirname(__FILE__)) . "/Baseobj.class.php");

	// Classe Activite

	// id --> identifiant activite
	// desc --> nom de l'activité

	class Messagedesc extends Baseobj{

		var $id;
		var $message;
		var $lang;
		var $intitule;
		var $titre;
		var $chapo;
		var $description;
		var $descriptiontext;

		const TABLE="messagedesc";
		var $table=self::TABLE;

		var $bddvars = array("id", "message", "lang", "intitule", "titre", "chapo", "description", "descriptiontext");

		function __construct($message = "", $lang = 1){
			parent::__construct();

			if($message != "")
 			  $this->charger($message, $lang);
		}

		function charger($message, $lang=1){
        	if(!$this->getVars("select * from $this->table where message=\"$message\" and lang=\"$lang\""))
				return $this->getVars("select * from $this->table where message=\"$message\" and lang=1");
			else
				return 1;
		}

		function charger_admin($message,$lang){
			if($lang=="") $lang=0;
			return $this->getVars("select * from $this->table where message=\"$message\" and lang=\"$lang\"");
		}

	}

?>